package org.zjt.spark.sql

import org.apache.spark.SparkConf
import org.apache.spark.sql.SparkSession

/**
  * DESC    
  *
  * @author
  * @create 2017-05-15 下午6:13
  **/
object SchemaRDDTest extends  App{

  val conf = new SparkConf().setAppName("SchemaRDDTest").setMaster("local")
  val  sql = new SparkSession.Builder().config(conf).getOrCreate()

  val data = sql.read.json("./person.json")

  data.createOrReplaceTempView("person")

  sql.sql("select name,age from person").show()

  sql.stop()

}
